﻿package com.wsascb.spriteTool
{
	import flash.display.Sprite;
	import flash.geom.ColorTransform;
	import flash.geom.Matrix;
	import flash.geom.Transform;

	public class SpriteTrans
	{

		static public function ColorTrans(spr:Sprite,color:uint):void
		{
			var resultColorTransform:ColorTransform = new ColorTransform();
			resultColorTransform.color = color;
			spr.transform.colorTransform = resultColorTransform;
		}
		static public function ColorAdvTrans(spr:Sprite,r:Number,g:Number,b:Number):void
		{
			var resultColorTransform:ColorTransform = new ColorTransform();
			resultColorTransform.redOffset = r;
			resultColorTransform.greenOffset = g;
			resultColorTransform.blueOffset = b;
			spr.transform.colorTransform = resultColorTransform;
		}
		static public function removeColorTrans(spr:Sprite):void
		{
			var resultColorTransform:ColorTransform = new ColorTransform();
			resultColorTransform.redOffset = 0;
			resultColorTransform.greenOffset = 0;
			resultColorTransform.blueOffset = 0;
			spr.transform.colorTransform = resultColorTransform;
		}

	}

}